* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  color: #1f2937;
  background: #f7fafc;
}

.app {
  max-width: 900px;
  margin-top: 10%;
  margin-left: auto;
  margin-right: auto;
  padding: 24px;
  border: 3px solid #3b82f6;
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.app__header {
  text-align: center;
  margin-bottom: 16px;
}
.app__header h1 {
  margin: 0;
  font-size: 32px;
  font-family: "Courier New";
  color: purple;
}
.subtitle {
  color: #6b7280;
  margin: 4px 0 0;
}

.new {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin: 16px 0 8px;
}
.new__input {
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  outline: none;
  background: white;
}
.new__input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 8px;
}
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #e5e7eb;
  color: #111827;
  cursor: pointer;
}
.btn--primary {
  background: #3b82f6;
  color: white;
}
.btn--ghost {
  background: transparent;
  border-color: #d1d5db;
}
.btn--warn {
  background: #ef4444;
  color: white;
}
.btn:hover {
  filter: brightness(0.95);
}
.btn.is-active {
  border-color: #3b82f6;
  color: #3b82f6;
}

.list {
  margin-top: 8px;
}
.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: white;
  border: 1px solid #e5e7eb;
}
.todo-item__label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.todo-item__title {
  font-size: 16px;
}
.todo-item.completed .todo-item__title {
  color: #9ca3af;
  text-decoration: line-through;
}

.todo-item__actions {
  display: flex;
  gap: 4px;
}
.todo-item__btn {
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
}
.todo-item__btn:hover {
  background: #f3f4f6;
}
.todo-item__edit {
  display: none;
}
.todo-item.editing .todo-item__view {
  display: none;
}
.todo-item.editing .todo-item__edit {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.todo-item__input {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

.footer {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  padding: 12px;
}
.footer .stats {
  display: flex;
  gap: 12px;
}
.footer .hint {
  font-size: 13px;
}

@media (max-width: 520px) {
  .app {
    padding: 16px;
  }
  .footer {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}
